/*
 * Copyright (c) 2025 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#ifndef DEV_PLDM_OVER_MCTP_STANDARD_H
#define DEV_PLDM_OVER_MCTP_STANDARD_H

#include <pldm_over_mctp/pldm_over_mctp.h>
#include <cstdint>
#include <vector>
#include <string>
#include <variant>
#include <pldm/pldm_protocol.h>

namespace dev {

using SensorReading = std::variant<
    uint8_t,   
    int8_t,    
    uint16_t, 
    int16_t,  
    uint32_t, 
    int32_t 
>;
// Numeric sensor reading result structure
struct NumericSensorReading {
    uint8_t completion_code;           // Completion code
    uint8_t sensor_data_size;          // Sensor data size
    uint8_t sensor_operational_state;  // Sensor operational state
    uint8_t event_message_enable;      // Event message enable
    uint8_t present_state;             // Present state
    uint8_t previous_state;            // Previous state
    uint8_t event_state;               // Event state
    SensorReading reading;             // Sensor reading value
};

class MC_API pldm_over_mctp_standard : public pldm_over_mctp {
public:
    pldm_over_mctp_standard(mctp& mctp_obj) : pldm_over_mctp(mctp_obj) {};
    ~pldm_over_mctp_standard() {};

    bool get_sensor_reading(uint16_t sensor_id, bool rearm_event_state, NumericSensorReading& result);


    bool get_state_sensor_readings(uint16_t sensor_id, uint8_t sensor_rearm, 
                                   std::vector<pldm_statesensor_field_t>& state_fields);

};

} // namespace dev

#endif // DEV_PLDM_OVER_MCTP_STANDARD_H
